<?php
namespace Admin\Controller;
use Think\Controller;

class GoodsimgController extends CommonController {
	public function index(){
		$img = D('Goods_img');
		$list = $img->join('goods ON goods_img.good_id = goods.id')->field('goods_img.id as img_id,good_id,name,good_name')->order('img_id')->select();
		$this->assign('list',$list);
		$this->display();
	}
	public function delete($id){
        $delete = M('goods_img');
        $delete->delete($id);
        if($delete){
            $this->success("删除成功", U('Goodsimg/index'));
        }else{
            $this->error("删除失败");
        }
    }
}